package com.yuncheng.spcyApi.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yuncheng.common.base.service.impl.BaseServiceImpl;
import com.yuncheng.spcyApi.dto.SjxdSqrBeanDto;
import com.yuncheng.spcyApi.dto.SpcySjxdJbxxDto;
import com.yuncheng.spcyApi.entity.SpcySjxdJbxx;
import com.yuncheng.spcyApi.flow.SpcyFlowConstant;
import com.yuncheng.spcyApi.mapper.SpcySjxdJbxxMapper;
import com.yuncheng.spcyApi.service.ISpcySjxdJbxxService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author hua
 */
@Service
public class SpcySjxdJbxxService extends BaseServiceImpl<SpcySjxdJbxxMapper, SpcySjxdJbxx> implements ISpcySjxdJbxxService {

    @Resource
    private SpcySjxdJbxxMapper spcySjxdJbxxMapper;

    @Override
    public String selectXdSqsxIdById(String id) {
        return spcySjxdJbxxMapper.selectXdSqsxIdById(id);
    }

    @Override
    public SpcySjxdJbxxDto selectCommonJbxxById(String id) {
        return spcySjxdJbxxMapper.selectCommonJbxxById(id);
    }

    @Override
    public List<SpcySjxdJbxx> selectSjxdByFlcztAndFsqsxid(String flczt, String sqsxid) {
        return spcySjxdJbxxMapper.selectSjxdByFlcztAndFsqsxid(flczt, sqsxid);
    }

    @Override
    public void updateFlcztById(String id, String flczt) {
        LambdaUpdateWrapper<SpcySjxdJbxx> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(SpcySjxdJbxx::getId, id);

        SpcySjxdJbxx updateBean = new SpcySjxdJbxx();
        updateBean.setFlczt(flczt);
        update(updateBean, updateWrapper);
    }

    @Override
    public SjxdSqrBeanDto selectSjxdSqrBeanById(String id) {
        return spcySjxdJbxxMapper.selectSjxdSqrBeanById(id);
    }
}
